package com.changcheng.project.yuminsi.enums;

/**
 * @author yuminsi
 * @description
 * @date 2020/9/18 15:29
 * @since
 */
public enum GenderEnum {
    /**
     *
     */
    GENDER_1("0","女"),
    /**
     *
     */
    GENDER_2("1","男"),
    /**
     *
     */
    GENDER_3("2","未知");
    private String code;
    private String name;

    GenderEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    GenderEnum() {
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static GenderEnum getGenderType(String code){
        for (GenderEnum gender : values()){
            if (gender.getCode().equals(code)){
                return gender;
            }
        }
        return null;
    }
}


